package com.guigu.www.mapper;

import com.guigu.www.pojo.TemplateFood;
import com.guigu.www.pojo.TemplateKeep;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author DengHao
 * @since 2021-10-21
 */
public interface TemplateKeepMapper extends BaseMapper<TemplateKeep> {

    /*罗露金*/
    @Select("SELECT * FROM template_keep tk INNER JOIN keep_inner ki " +
            "ON tk.`temp_keep_id`=ki.`temp_keep_id` " +
            "WHERE ki.`keep_zong_id`=#{keepZongId}")
    List<TemplateKeep> queryById(int keepZongId);

    /*陈显科 根据运动方案干预方案id查询*/
    @Select("SELECT * FROM template_keep WHERE temp_keep_id  IN(\n" +
            "SELECT temp_keep_id FROM keep_inner WHERE keep_zong_id =#{kid})")
    List<TemplateKeep> selectKid(@Param("kid") int kid);
}
